#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,m,suf[N];
char s[N],t[N];
int g[N],ti[N];
vector<int> f[N];
void print(int k,int i){
	if(k>1) print(k-1,f[i][k]);
	printf("%d ",i);
}
struct CNM{int v,j,t;};
vector<CNM> T[N];
int main(){
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	scanf("%s",s+1),scanf("%s",t+1);
	n=strlen(s+1),m=strlen(t+1);
	if(1ll*n*m>4e6){
		vector<int> ans;
		for(int j=1,i=1;j<=m;++j){
			while(i<=n&&s[i]!=t[j]) ++i;
			if(i>n) return cout<<"NO",0;
			ans.push_back(i);
		}
		puts("YES");
		for(int i:ans) printf("%d ",i);
		return 0;
	}
	for(int i=0;i<=n;++i) f[i].resize(m+1);
	for(int i=n;i;--i) suf[i]=(s[i]==s[i+1]?suf[i+1]:i+1);
	if(s[1]==t[1]){
		for(int i=1;i<suf[1];++i) f[i][1]=-1;
	}else{
		if(suf[1]>n) return cout<<"NO",0;
		f[suf[1]][1]=-1;
	}
	for(int i=0;;++i){
		for(CNM p:T[i]) if(p.t>ti[p.j]) g[p.j]=p.v,ti[p.j]=p.t;
		for(int j=1;j<=m;++j) if(ti[j]>i) f[i][j]=g[j];
		if(i==n) break;
		for(int j=1;j<m;++j) if(f[i][j]){
			if(t[j+1]==t[j]){
				if(s[i+1]!=s[i]) f[suf[i+1]][j+1]=i;
				else T[i+1].push_back((CNM){i,j+1,suf[i]});
			}else{
				if(s[i+1]==s[i]) f[suf[i]][j+1]=i;
				else T[i+1].push_back((CNM){i,j+1,suf[i+1]});
			}
		}
	}
	for(int i=n;i;--i) if(f[i][m]){
		puts("YES");
		print(m,i);
		return 0;
	}else if(s[i]!=s[n]) break;
	puts("NO");
	return 0;
}


